package com.hello.system.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import com.hello.common.core.constant.SecurityConstants;
import com.hello.common.core.constant.ServiceNameConstants;
import com.hello.common.core.domain.R;
import com.hello.system.api.factory.RemoteWxFallbackFactory;

import java.util.Map;

/**
 * 微信用户服务
 * 
 * @author hello
 */
@FeignClient(contextId = "remoteWxService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteWxFallbackFactory.class)
public interface RemoteWxService {
    /**
     * 获取微信openid
     *
     * @param params 包含code的请求参数
     * @param source 请求来源
     * @return 包含openid和sessionKey的Map
     */
    @PostMapping("/wx/user/openid")
    public R<Map<String, Object>> getWxOpenid(@RequestBody Map<String, String> params, 
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
} 